const seq = require('sequelize')
const time = require('../time')

module.exports = {
  NAME: 'data_sql',
  TABLE: {
    data_sql_id: {
      type: seq.INTEGER(11),
      primaryKey: true,
      unique: true,
      autoIncrement: true,
      comment: 'data_sql_id 主键，自增',
      field: 'data_sql_id' //  相应的字段名称
    },
    name: {
      type: seq.STRING(64),
      comment: 'sql名称',
      field: 'name'
    },
    data_source_id: {
      type: seq.INTEGER(11),
      comment: '数据源id',
      field: 'data_source_id'
    },
    code: {
      type: seq.TEXT,
      comment: 'sql 查询 code',
      field: 'code'
    },
    remark: {
      type: seq.TEXT,
      comment: '备注',
      field: 'remark',
    },
    ...time.create_date,
    ...time.update_date,
    ...time.delete_date,
    ...time.create_by,
    ...time.update_by,
    ...time.delete_by
  }
}
